﻿// Decompiled with JetBrains decompiler
// Type: TaleWorlds.MountAndBlade.View.CraftedDataViewManager
// Assembly: TaleWorlds.MountAndBlade.View, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 61152EB8-513B-4D4A-8AC0-0D1465C6CF6C
// Assembly location: D:\steam\steamapps\common\Mount & Blade II Bannerlord\Modules\Native\bin\Win64_Shipping_Client\TaleWorlds.MountAndBlade.View.dll

using System.Collections.Generic;
using TaleWorlds.Core;

#nullable disable
namespace TaleWorlds.MountAndBlade.View
{
  public class CraftedDataViewManager
  {
    private static Dictionary<WeaponDesign, CraftedDataView> _craftedDataViews;

    public static void Initialize()
    {
      CraftedDataViewManager._craftedDataViews = new Dictionary<WeaponDesign, CraftedDataView>();
    }

    public static void Clear()
    {
      foreach (CraftedDataView craftedDataView in CraftedDataViewManager._craftedDataViews.Values)
        craftedDataView.Clear();
      CraftedDataViewManager._craftedDataViews.Clear();
    }

    public static CraftedDataView GetCraftedDataView(WeaponDesign craftedData)
    {
      if (!(craftedData != (WeaponDesign) null))
        return (CraftedDataView) null;
      CraftedDataView craftedDataView;
      if (!CraftedDataViewManager._craftedDataViews.TryGetValue(craftedData, out craftedDataView))
      {
        craftedDataView = new CraftedDataView(craftedData);
        CraftedDataViewManager._craftedDataViews.Add(craftedData, craftedDataView);
      }
      return craftedDataView;
    }
  }
}
